<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="css/bootstrap.css" />
	<link rel="stylesheet" href="css/wall.css" />
	<title>最新动态</title>
	<script type="text/javascript" src="js/jquery.js"></script>
	<style type="text/css">
		body{
			background-image:url(img/scribble_light.png);
		}
	</style>	
</head>
<body>
	<div class="navbar">
		<div class="navbar-inner">
			<div class="container">
				<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				</a>
				<a class="brand" href="#" style="margin-left:50px">${projectname }</a>
				<div class="nav-collapse">
				  <ul class="nav">
					<li class="active"><a href="messages.jspx">最新动态</a></li>
					<li><a href="goal.jspx">目标</a></li>
					<li><a href="document.jspx">资料库</a></li>
					<li><a href="filetype.jspx">文件共享</a></li>
					<li><a href="person.jspx">联系人</a></li>
					<li><a href="idea.jspx">想法</a></li>
					<li><a href="#">Bug</a></li>
					<li><a href="#">项目设置</a></li>					
				  </ul>					
				</div>
			</div>
		</div>
	</div>
	<div class="container" style="margin-left:200px">
		<div class="row">				
			<div class="sed">
				<div class="span6">
					<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;">
						<li class="active">
							<i class="icon-th"></i>你在想什么？
						</li>
					</ul>
					<form style="margin:20px" id="myform" action="messages.jspx?_m=save" method="post">
						<input type="hidden" name="t_user_id" value="${user.id }">
						<input type="hidden" name="t_project_id" value="${project.id }">
						<textarea name="content" id="error_xinxi" style="width:415px" rows="3"></textarea>
						<button class="btn btn-primary" id="btn">发布</button>
					</form>
					<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:20px">
						<li class="active">
							<i class="icon-th"></i>信息流
						</li>
						<c:forEach items="${requestScope.messages}" var="p">
						<blockquote>
				
					<p>${p.content }</p>					
					<small>${p.user.username} 发布于${p.createtime }</small>
					
					</blockquote>
				</c:forEach>
					
					</ul>				
				</div>
			</div>
			<div class="span3">
				
			</div>	
		</div>
	</div>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#btn").click(function(){
				var xinxi = $("input[name = 'name']").val();
				
				if(xinxi == ""){
					$("#error_xinxi").html("请输入你想发布的信息");
					return;
				}
				$("#myform").submit();
			});
		});
	</script>	
</body>
</html>